package com.cncytech.uiautomator_demo.testcase;

import com.cncytech.uiautomator_demo.BaseTest;
import com.cncytech.uiautomator_demo.RetryWatcher;
import com.cncytech.uiautomator_demo.TestConstant;
import com.cncytech.uiautomator_demo.utils.Describe;

import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.*;

import org.junit.Rule;
import org.junit.Test;

public class WlanApPoliciesTest extends BaseTest {

    @Rule
    public RetryWatcher retryWatcher = new RetryWatcher(TestConstant.retryCount);

    @Test
    @Describe(TestConstant.WLANAP_FORBIDDEN)
    public void wlanApForbiddenTest() {
        String msg = TestConstant.WLANAP_FORBIDDEN + TestConstant.FAILURE;
        int status = 0;
        assertThat(msg, tm.setWlanApPolicies(status, null));
        String[] wlanApPolicies = tm.getWlanApPolicies();
        assertThat(msg, wlanApPolicies[0], is("0"));
    }

    @Test
    @Describe(TestConstant.WLANAP_ALLOWED_PARTIAL)
    public void wlanApAllowedPartialTest() {
        String msg = TestConstant.WLANAP_ALLOWED_PARTIAL + TestConstant.FAILURE;
        int status = 1;
        assertThat(msg, tm.setWlanApPolicies(status, new String[]{"D0-B4-5D-5C-73-8D"}));
        String[] wlanApPolicies = tm.getWlanApPolicies();
        assertThat(msg, wlanApPolicies[0], is(""+status));
    }
}
